package pl.easyshop.core.services.user;

import java.util.Date;
import java.util.HashSet;
import java.util.Set;

import pl.easyshop.core.model.enums.UserAccountType;
import pl.easyshop.core.services.AbstractBaseData;
import pl.easyshop.core.services.user.group.UserGroupData;

public class UserData extends AbstractBaseData {
	
	/** Unique serialization identifier. */
	private static final long serialVersionUID = -5341848780111675044L;

	/** User name field is use during login process. */
	private String username;
	
	/** Password. */
	private String password;
	
	/** First name. */
	private String firstName;
	
	/** Last name. */
	private String lastName;
	
	/** E-mail address. */
	private String email;
	
	/** Active user account. */
	private boolean enabled;

	/** User account type. */
	private UserAccountType accountType;
	
	/** Create account date. */
	private Date createDate;
	
	/** Last modified date. */
	private Date modifiedDate;
	
	/** Field value <code>true</code> means user is currently logged in system. */
	private boolean online;
	
	/** Last login date. */
	private Date lastLoginDate;
	
	/** User groups. */
	private Set<UserGroupData> groups = new HashSet<UserGroupData>();

	
	/**
	 * Get user full name ({@link #firstName} + {@link #lastName}).
	 * @return
	 */
	public String getFullName(){
		return firstName + " " + lastName;
	}
	
	/**
	 * Get username property value.
	 * @return the username
	 */
	public String getUsername() {
		return username;
	}

	/**
	 * Set username property value.
	 * @param username the username to set
	 */
	public void setUsername(String username) {
		this.username = username;
	}

	/**
	 * Get password property value.
	 * @return the password
	 */
	public String getPassword() {
		return password;
	}

	/**
	 * Set password property value.
	 * @param password the password to set
	 */
	public void setPassword(String password) {
		this.password = password;
	}

	/**
	 * Get firstName property value.
	 * @return the firstName
	 */
	public String getFirstName() {
		return firstName;
	}

	/**
	 * Set firstName property value.
	 * @param firstName the firstName to set
	 */
	public void setFirstName(String firstName) {
		this.firstName = firstName;
	}

	/**
	 * Get lastName property value.
	 * @return the lastName
	 */
	public String getLastName() {
		return lastName;
	}

	/**
	 * Set lastName property value.
	 * @param lastName the lastName to set
	 */
	public void setLastName(String lastName) {
		this.lastName = lastName;
	}

	/**
	 * Get email property value.
	 * @return the email
	 */
	public String getEmail() {
		return email;
	}

	/**
	 * Set email property value.
	 * @param email the email to set
	 */
	public void setEmail(String email) {
		this.email = email;
	}

	/**
	 * Get enabled property value.
	 * @return the enabled
	 */
	public boolean isEnabled() {
		return enabled;
	}

	/**
	 * Set enabled property value.
	 * @param enabled the enabled to set
	 */
	public void setEnabled(boolean enabled) {
		this.enabled = enabled;
	}

	/**
	 * Get accountType property value.
	 * @return the accountType
	 */
	public UserAccountType getAccountType() {
		return accountType;
	}

	/**
	 * Set accountType property value.
	 * @param accountType the accountType to set
	 */
	public void setAccountType(UserAccountType accountType) {
		this.accountType = accountType;
	}

	/**
	 * Get createDate property value.
	 * @return the createDate
	 */
	public Date getCreateDate() {
		return createDate;
	}

	/**
	 * Set createDate property value.
	 * @param createDate the createDate to set
	 */
	public void setCreateDate(Date createDate) {
		this.createDate = createDate;
	}

	/**
	 * Get modifiedDate property value.
	 * @return the modifiedDate
	 */
	public Date getModifiedDate() {
		return modifiedDate;
	}

	/**
	 * Set modifiedDate property value.
	 * @param modifiedDate the modifiedDate to set
	 */
	public void setModifiedDate(Date modifiedDate) {
		this.modifiedDate = modifiedDate;
	}

	/**
	 * Get online property value.
	 * @return the online
	 */
	public boolean isOnline() {
		return online;
	}

	/**
	 * Set online property value.
	 * @param online the online to set
	 */
	public void setOnline(boolean online) {
		this.online = online;
	}

	/**
	 * Get lastLoginDate property value.
	 * @return the lastLoginDate
	 */
	public Date getLastLoginDate() {
		return lastLoginDate;
	}

	/**
	 * Set lastLoginDate property value.
	 * @param lastLoginDate the lastLoginDate to set
	 */
	public void setLastLoginDate(Date lastLoginDate) {
		this.lastLoginDate = lastLoginDate;
	}

	/**
	 * Get groups property value.
	 * @return the groups
	 */
	public Set<UserGroupData> getGroups() {
		return groups;
	}

	/**
	 * Set groups property value.
	 * @param groups the groups to set
	 */
	public void setGroups(Set<UserGroupData> groups) {
		this.groups = groups;
	}
}
